#ifndef __MULTI_OSD_H__
#define __MULTI_OSD_H__

#include <string>
#include <opencv2/opencv.hpp>
#include "sdc.h"
#include "types.h"

extern GC_APP_CONFIG gc_app_config;

namespace gc
{
using std::string;
class JpegFile
{
public:
    JpegFile(void);
    virtual ~JpegFile(void);
    int32_t Init(void);
    int32_t SaveJpeg(sdc_yuv_frame_s &yuv_frame, string &jpegPath) const;
    int32_t SaveJpeg(sdc_yuv_frame_s &yuv_frame, int forwardsize_w, int forwardsize_h, unsigned char * pyuv, cv::Mat &dst, std::string &save_path) const;
    
protected:
    int32_t m_codecFd;  // 图片解码文件描述符

private:
    int32_t InitOsdRegion(sdc_yuv_frame_s &yuv_frame, sdc_osd_region_s &osd_region) const;
    int32_t Yuv2Jpeg(sdc_yuv_frame_s &yuv_frame, sdc_osd_region_s &osd_region, sdc_jpeg_frame_s &jpeg_frame) const;
    int32_t SaveJpeg(sdc_jpeg_frame_s &jpeg_frame, string &jpegPath) const;
    int32_t FreeJpeg(sdc_jpeg_frame_s &jpeg_frame) const;
    int32_t YuvToMat(sdc_yuv_frame_s &yuv_frame, cv::Mat &dst) const;
};
}
#endif